var lengthOfLongestSubstring = function(s) {
  let j = 0;
  let max = 0;
  const map = new Map();
 for(let i = 0; i < s.length ; i++){
   if(map.has(s[i])){
    j = Math.max(map.get(s[i])+1,j);
   }
    map.set(s[i],i)
    max = Math.max(max,i-j+1)
 }
  return max;
};
console.log(lengthOfLongestSubstring("abba"));
let a = [1,3];
let b = [];
a.push(...b);
a.sort();
console.log(a);